<template>
  <div id="UserInfo">
    <div>
      <h3 id="title">
        个人信息
      </h3>
    </div>
    <Back></Back>
  <el-table
      :data="tableData"
      style="width: 100%">
    <el-table-column
        prop="n_name"
        label="用户名"
        width="180">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.n_name }}</span>
      </template>
    </el-table-column>
    <el-table-column
        prop="password"
        label="登陆密码"
        width="180">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.password }}</span>
      </template>
    </el-table-column>
    <el-table-column
        prop="real_name"
        label="用户真实姓名"
        width="180">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.real_name }}</span>
      </template>
    </el-table-column>
    <el-table-column
        prop="phone"
        label="电话号码"
        width="180">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.phone }}</span>
      </template>
    </el-table-column>
    <el-table-column
        prop="IdCard"
        label="身份证号"
        width="180">
      <template slot-scope="scope">
        <span style="margin-left: 10px">{{ scope.row.IdCard }}</span>
      </template>
    </el-table-column>
    <el-table-column
        prop="end_time"
        label="最后登陆时间"
        width="180">
      <template slot-scope="scope">
        <i class="el-icon-time"></i>
        <span style="margin-left: 10px">{{ scope.row.end_time }}</span>
      </template>
    </el-table-column>
    <el-table-column
        prop="r_time"
        label="注册时间"
        width="180">
      <template slot-scope="scope">
        <i class="el-icon-time"></i>
        <span style="margin-left: 10px">{{ scope.row.r_time }}</span>
      </template>
    </el-table-column>
    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button
            size="mini"
            @click="handleEdit(scope.$index, scope.row)">修改</el-button>
      </template>
    </el-table-column>
  </el-table>
  </div>
</template>

<script>
import back from '@/components/back/Return';
import { deposit } from '@/api/info';

export default {
name: "UserInfo",
  data() {
    return {
      tableData: [{
        n_name: 'dd',
        password:'1233',
        real_name: '王小虎',
        phone: '151413131',
        IdCard: '541313131',
        end_time: '2016',
        r_time: '2018'}]
    }
  },
  mounted() {
  this.info()
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row);
      this.$router.push("/updateInfo")
    },
  /*  handleDelete(index, row) {
      console.log(index, row);
    }*/
    info(){
      //发送请求
      deposit(this.$route.params).then(respone=>{
        console.log(respone);
      }).catch(error=>{
        console.log(error);
      })
    },
  },
  components: {
    'Back': back
  }
}
</script>

<style scoped>
#title{
  line-height: 100px;
  text-align: center;
  color: #00a854;
}
</style>